#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMouseEvent>
#include "pcf8574.h"
#include "CH341DLL.H"

#define TEXT_COLOR_REDACK(STRING,iDevice)         iDevice + " ack = <font color=red>" + STRING + "</font>" "<font color=black> </font>"
#define TEXT_COLOR_BLUEACK(STRING,iDevice)        iDevice + " ack = <font color=blue>" + STRING +"</font>" "<font color=black> </font>"
#define TEXT_COLOR_GREENACK(STRING,iDevice)       iDevice + " ack = <font color=green>" + STRING +"</font>" "<font color=black> </font>"

#define TEXT_COLOR_RED(STRING)         "<font color=red>"  STRING  "</font>" "<font color=black> </font>"
namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    PCF8574 *pcf8574;

    static void _stdcall Device_status_update(unsigned long iEventStatus);

private slots:

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    void on_eerom_type_activated(int index);

    void on_openled_clicked();

    void on_closeled_clicked();

    void on_ic_type_activated(int index);

    void on_ic_number_activated(int index);

    void on_min_clicked_clicked();

    void on_close_clicked_clicked();

    void on_deleteLog_clicked();

    void open_closeDevice();

private:
    Ui::MainWindow *ui;
    void initconnect();
};

#endif // MAINWINDOW_H
